<template>
  <div class="list-news">
    <div
      v-for="(item, idx) in newskind.slice(0, index)"
      :key="idx"
      class="news"
    >
      <ul>
        <li>
          <div class="img-left">
            <a href=""><img :src="newskind[idx].img" alt="" /></a>
          </div>
          <div class="news-right">
            <p>{{ newskind[idx].title }}</p>
            <p>{{ newskind[idx].summary }}</p>
            <!-- <input type="text" v-model="defaultIndex"> -->
            <div class="info">
              <p>
                {{ newskind[idx].author }} <em>.</em>
                <span>{{ newskind[idx].time }}</span>
              </p>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { getNews } from "@/api";

export default {
  name: "news",
  props: ["index", "newskind"],
  data() {
    return {
      msg: "这是资讯",
      ggg: ["你好，我是子"],
    };
  },
};
</script>
<style lang="less">
.list-news {
  width: 1184px;
  background: #ffffff;
  .news {
    padding: 25px 100px;
    li {
      display: flex;
      justify-content: space-between;
      .img-left {
        margin-right: 40px;
        width: 284px;
        height: 156px;
        overflow: hidden;
        flex-shrink: 0;
        img {
          width: 284px;
        }
      }
      .news-right {
        height: 156px;
        :nth-child(n) {
          width: 654px;
        }
        :nth-child(2) {
          height: 75px;
          padding-top: 20px;
          margin-bottom: 15px;
        }
      }
    }
  }
}
</style>